home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / NoteObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  29.9 KB  |  703 lines  |  [TEXT/KAHL]

  1. /* NoteObject.h */
  2.  
  3. #ifndef Included_NoteObject_h
  4. #define Included_NoteObject_h
  5.  
  6. /* NoteObject module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* BinaryCodedDecimal */
  12. /* Memory */
  13. /* Screen */
  14. /* Fractions */
  15. /* DrawCommand */
  16. /* DataMunging */
  17. /* Numbers */
  18. /* Frequency */
  19. /* MainWindowStuff */
  20. /* BufferedFileInput */
  21. /* BufferedFileOutput */
  22. /* TempoController */
  23.  
  24. #include "Screen.h"
  25. #include "BinaryCodedDecimal.h"
  26. #include "MainWindowStuff.h"
  27.  
  28. /* forward declarations */
  29. struct FractionRec;
  30. struct BufferedInputRec;
  31. struct BufferedOutputRec;
  32.  
  33. #ifdef ShowMe_NoteObjectRec
  34. /* declared publicly for fast access during play routines */
  35. struct NoteObjectRec
  36.     {
  37.         /* flags field.  if high bit is set, then it is a command and the low order */
  38.         /* bits are the opcode.  if high bit is clear, then it is a note and the low */
  39.         /* order bits determine the duration and some other information */
  40.         unsigned long                    Flags;
  41.  
  42.         /* data fields */
  43.         union
  44.             {
  45.                 struct
  46.                     {
  47.                         /* halfstep pitch index */
  48.                         short                                    Pitch;
  49.  
  50.                         /* portamento rate flag.  this parameter determines how long a portamento */
  51.                         /* transition should take, in fractions of a quarter note.  it only has */
  52.                         /* effect if this note is the target of a tie.  A value of 0 means it */
  53.                         /* should be instantaneous, i.e. no portamento. */
  54.                         SmallBCDType                    PortamentoDuration;
  55.  
  56.                         /* displacement forward and backward, in fractions of a quarter note. */
  57.                         /* this value is added to the current overall early/late adjust factor */
  58.                         /* as determined by the default and any adjustments or sweeps in progress */
  59.                         /* as initiated by channel commands */
  60.                         SmallBCDType                    EarlyLateAdjust;
  61.  
  62.                         /* note duration adjustment, in fractions of a quarter note.  this value */
  63.                         /* is either added to or multiplied by the duration to make the note run */
  64.                         /* longer or shorter.  this does not effect when subsequent notes start. */
  65.                         SmallBCDType                    DurationAdjust;
  66.  
  67.                         /* note to tie after completion of this note (NIL = none) */
  68.                         struct NoteObjectRec*    Tie;
  69.  
  70.                         /* these are fine tuning adjustment parameters.  they correspond to */
  71.                         /* some of the values that can be set by commands.  the values in */
  72.                         /* these parameters have effect over and above the effects of the */
  73.                         /* values set in the commands (i.e. the effects are cumulative) when */
  74.                         /* appropriate. */
  75.  
  76.                         /* release points as a fraction of the note's duration */
  77.                         /* these are relative to either the beginning of the note (key-down) or */
  78.                         /* the end of the note (duration counter runout) as determined by some */
  79.                         /* bits in the flags word.  If the flag indicates that the default origin */
  80.                         /* should be used, then this value is added to the channel overall/default */
  81.                         /* value, otherwise the default value is not used. */
  82.                         SmallBCDType                    ReleasePoint1;
  83.                         SmallBCDType                    ReleasePoint2;
  84.  
  85.                         /* adjustment for overall loudness envelope */
  86.                         /* this factor multiplicatively scales the output volume of the channel, */
  87.                         /* so a value of 1 leaves it unchanged.  This scaling is in addition to */
  88.                         /* the channel overall/default scaling, by multiplying the values. */
  89.                         SmallBCDType                    OverallLoudnessAdjustment;
  90.  
  91.                         /* left-right positioning adjustment for the note */
  92.                         /* this factor determines where the sound will come from when stereo */
  93.                         /* synthesis is being used.  -1 is far left, 1 is far right, and 0 is */
  94.                         /* center.  This is added to the channel overall/default position. */
  95.                         SmallBCDType                    StereoPositionAdjustment;
  96.  
  97.                         /* front-back positioning adjustment for the note */
  98.                         /* this factor determines where the sound will come from when surround */
  99.                         /* synthesis is being used.  1 is far front and -1 is far rear.  this */
  100.                         /* is added to the channel overall/default position */
  101.                         SmallBCDType                    SurroundPositionAdjustment;
  102.  
  103.                         /* special accent adjustments value for wave table generators */
  104.                         /* these factors are the base-2 log of multiplicative scaling factors. */
  105.                         /* therefore, 0 makes no change, 1 doubles the target value, and -1 */
  106.                         /* halves it.  the values are combined with the respective global */
  107.                         /* channel values via addition. */
  108.                         SmallBCDType                    Accent1;
  109.                         SmallBCDType                    Accent2;
  110.                         SmallBCDType                    Accent3;
  111.                         SmallBCDType                    Accent4;
  112.  
  113.                         /* then this is the pitch to use to select the sample or wave table from */
  114.                         /* the multisample list instead of Pitch.  if this is -1, then Pitch */
  115.                         /* should be used for sample selection. */
  116.                         short                                    MultisamplePitchAsIf;
  117.  
  118.                         /* adjustment factor for pitch displacement depth envelope amplitude. */
  119.                         /* this factor determines the depth of the frequency LFO generators. */
  120.                         /* the envelope controlling the depth is taken as a value from 0..1. */
  121.                         /* this parameter provides units, either as Hertz or halfsteps (as */
  122.                         /* indicated by some bits in the flags word) and the value is added to */
  123.                         /* the overall channel/default value (after Hertz/halfstep conversion). */
  124.                         /* If the flags indicate that the default pitch conversion should be */
  125.                         /* used, then this value is used to multiplicatively scale the default */
  126.                         /* adjustment. */
  127.                         SmallBCDType                    PitchDisplacementDepthAdjustment;
  128.  
  129.                         /* adjustment factor for pitch displacement rate envelope amplitude. */
  130.                         /* this factor determines the rate of the frequency LFO generators.  the */
  131.                         /* envelope controlling the rate is taken as a value from 0..1.  this */
  132.                         /* parameter provides units, in periods per second, for scaling the rate */
  133.                         /* envelope output.  This value is added to the overall channel/default */
  134.                         /* value. */
  135.                         SmallBCDType                    PitchDisplacementRateAdjustment;
  136.  
  137.                         /* selection of pitch displacement envelope start point. */
  138.                         /* this specifies when the pitch displacement LFOs start.  this value */
  139.                         /* is relative to the start or end of the note, as determined by some */
  140.                         /* bits in the flags word.  If the flags specify that the default origin */
  141.                         /* should be used, then the value is added to the default start point, */
  142.                         /* otherwise the default start point is not used. */
  143.                         SmallBCDType                    PitchDisplacementStartPoint;
  144.  
  145.                         /* overall envelope rate adjustment. */
  146.                         /* this factor scales the total speed with which all envelopes associated */
  147.                         /* with the note undergo transitions.  A value of 1 does not change them, */
  148.                         /* smaller values accelerate transition.  This value is in addition to */
  149.                         /* the channel/default value via multiplication of the values. */
  150.                         SmallBCDType                    HurryUpFactor;
  151.  
  152.                         /* detuning in either Hertz or halfsteps. */
  153.                         /* this value specifies how much to detune the nominal pitch of the note. */
  154.                         /* the value is either in units of Hertz or halfsteps, as determined by */
  155.                         /* a bit in the flags word, and the detuning is added to the channel */
  156.                         /* overall/default detuning.  If the flags indicate that the default */
  157.                         /* pitch coversion should be used, then this value is multiplied by */
  158.                         /* the channel overall/default value to scale it. */
  159.                         SmallBCDType                    Detuning;
  160.                     }    Note;
  161.  
  162.                 struct
  163.                     {
  164.                         /* string argument for commands.  NIL means it hasn't been defined */
  165.                         char*                                    StringArgument;
  166.                         /* numeric arguments for commands */
  167.                         long                                    Argument1;
  168.                         long                                    Argument2;
  169.                         long                                    Argument3;
  170.                     } Command;
  171.             } a;
  172.     };
  173. #else
  174. struct NoteObjectRec;
  175. #endif
  176.  
  177. typedef struct NoteObjectRec NoteObjectRec;
  178.  
  179. /* note flags and duration stuff */
  180. #define BIT(x) (1UL << (x))
  181.  
  182. #define eDurationMask (BIT(0) | BIT(1) | BIT(2) | BIT(3))
  183. #define e64thNote (1 * BIT(0)) /* value 0 skipped */
  184. #define e32ndNote (2 * BIT(0))
  185. #define e16thNote (3 * BIT(0))
  186. #define e8thNote (4 * BIT(0))
  187. #define e4thNote (5 * BIT(0))
  188. #define e2ndNote (6 * BIT(0))
  189. #define eWholeNote (7 * BIT(0))
  190. #define eDoubleNote (8 * BIT(0))
  191. #define eQuadNote (9 * BIT(0))
  192.  
  193. #define eDivisionMask (BIT(4) | BIT(5))
  194. #define eDiv1Modifier (0 * BIT(4))
  195. #define eDiv3Modifier (1 * BIT(4))
  196. #define eDiv5Modifier (2 * BIT(4))
  197. #define eDiv7Modifier (3 * BIT(4))
  198.  
  199. #define eDotModifier (BIT(6))
  200. #define eFlatModifier (BIT(7))
  201. #define eSharpModifier (BIT(8))
  202. #define eRestModifier (BIT(9))
  203.  
  204. #define eRelease1OriginMask (BIT(10) | BIT(11))
  205. #define eRelease1FromDefault (1 * BIT(10))
  206. #define eRelease1FromStart (2 * BIT(10))
  207. #define eRelease1FromEnd (3 * BIT(10))
  208.  
  209. #define eRelease2OriginMask (BIT(12) | BIT(13))
  210. #define eRelease2FromDefault (1 * BIT(12))
  211. #define eRelease2FromStart (2 * BIT(12))
  212. #define eRelease2FromEnd (3 * BIT(12))
  213.  
  214. #define eRelease3FromStartNotEnd (BIT(14))
  215.  
  216. #define ePitchDisplacementStartOriginMask (BIT(15) | BIT(16))
  217. #define ePitchDisplacementStartFromDefault (1 * BIT(15))
  218. #define ePitchDisplacementStartFromStart (2 * BIT(15))
  219. #define ePitchDisplacementStartFromEnd (3 * BIT(15))
  220.  
  221. #define ePitchDisplacementDepthModeMask (BIT(17) | BIT(18))
  222. #define ePitchDisplacementDepthModeDefault (1 * BIT(17))
  223. #define ePitchDisplacementDepthModeHalfSteps (2 * BIT(17))
  224. #define ePitchDisplacementDepthModeHertz (3 * BIT(17))
  225.  
  226. #define eDetuningModeMask (BIT(19) | BIT(20))
  227. #define eDetuningModeDefault (1 * BIT(19))
  228. #define eDetuningModeHalfSteps (2 * BIT(19))
  229. #define eDetuningModeHertz (3 * BIT(19))
  230.  
  231. #define eDurationAdjustMask (BIT(21) | BIT(22))
  232. #define eDurationAdjustDefault (1 * BIT(21))
  233. #define eDurationAdjustAdditive (2 * BIT(21))
  234. #define eDurationAdjustMultiplicative (3 * BIT(21))
  235.  
  236. #define eRetriggerEnvelopesOnTieFlag (BIT(23))
  237.  
  238. #define ePortamentoHertzNotHalfsteps (BIT(24))
  239.  
  240. #define eCommandFlag (BIT(31))
  241.  
  242. /* commands (low order 31 bits of the flag word) */
  243. /* there are 4 parameters for commands: <1>, <2>, <3>, and <string> */
  244. /* commands <1>, <2>, and <3> can be interpreted as large BCD numbers (xx.xxxxxx), */
  245. /* extended small BCD numbers (xxxxx.xxx), or as integers */
  246. /* large is represented by <_l>, extended small is <_xs>, integer is <_i> */
  247. typedef enum
  248.     {
  249.         /* tempo adjustments */
  250.         eCmdRestoreTempo EXECUTE(= 17732), /* restore the tempo to the default for the score */
  251.         eCmdSetTempo, /* set tempo to <1xs> number of beats per minute */
  252.         eCmdIncTempo, /* add <1xs> to the tempo control */
  253.         eCmdSweepTempoAbs, /* <1xs> = target tempo, <2xs> = # of beats to reach it */
  254.         eCmdSweepTempoRel, /* <1xs> = target adjust (add to tempo), <2xs> = # beats */
  255.  
  256.         /* stereo positioning adjustments */
  257.         eCmdRestoreStereoPosition, /* restore stereo position to channel's default */
  258.         eCmdSetStereoPosition, /* set position in channel <1l>: -1 = left, 1 = right */
  259.         eCmdIncStereoPosition, /* adjust stereo position by adding <1l> */
  260.         eCmdSweepStereoAbs, /* <1l> = new pos, <2xs> = # of beats to get there */
  261.         eCmdSweepStereoRel, /* <1l> = pos adjust, <2xs> = # beats to get there */
  262.  
  263.         /* surround positioning adjustments */
  264.         eCmdRestoreSurroundPosition, /* restore surround position to channel's default */
  265.         eCmdSetSurroundPosition, /* set position in channel <1l>: 1 = front, -1 = rear */
  266.         eCmdIncSurroundPosition, /* adjust surround position by adding <1l> */
  267.         eCmdSweepSurroundAbs, /* <1l> = new pos, <2xs> = # of beats to get there */
  268.         eCmdSweepSurroundRel, /* <1l> = pos adjust, <2xs> = # beats to get there */
  269.  
  270.         /* overall volume adjustments */
  271.         eCmdRestoreVolume, /* restore the volume to the default for the channel */
  272.         eCmdSetVolume, /* set the volume to the specified level (0..1) in <1l> */
  273.         eCmdIncVolume, /* multiply <1l> by the volume control */
  274.         eCmdSweepVolumeAbs, /* <1l> = new volume, <2xs> = # of beats to reach it */
  275.         eCmdSweepVolumeRel, /* <1l> = volume adjust, <2xs> = # of beats to reach it */
  276.  
  277.         /* default release point adjustment values */
  278.         eCmdRestoreReleasePoint1, /* restore release point to master default */
  279.         eCmdSetReleasePoint1, /* set the default release point to new value <1l> */
  280.         eCmdIncReleasePoint1, /* add <1l> to default release point for adjustment */
  281.         eCmdReleasePointOrigin1, /* <1i> -1 = from start, 0 = from end of note */
  282.         eCmdSweepReleaseAbs1, /* <1l> = new release, <2xs> = # of beats to get there */
  283.         eCmdSweepReleaseRel1, /* <1l> = release adjust, <2xs> = # of beats to get there */
  284.  
  285.         eCmdRestoreReleasePoint2, /* restore release point to master default */
  286.         eCmdSetReleasePoint2, /* set the default release point to new value <1l> */
  287.         eCmdIncReleasePoint2, /* add <1l> to default release point for adjustment */
  288.         eCmdReleasePointOrigin2, /* <1i> -1 = from start, 0 = from end of note */
  289.         eCmdSweepReleaseAbs2, /* <1l> = new release, <2xs> = # of beats to get there */
  290.         eCmdSweepReleaseRel2, /* <1l> = release adjust, <2xs> = # of beats to get there */
  291.  
  292.         /* set the default accent values */
  293.         eCmdRestoreAccent1, /* restore accent value to master default */
  294.         eCmdSetAccent1, /* specify the new default accent in <1l> */
  295.         eCmdIncAccent1, /* add <1l> to the default accent */
  296.         eCmdSweepAccentAbs1, /* <1l> = new accent, <2xs> = # of beats to get there */
  297.         eCmdSweepAccentRel1, /* <1l> = accent adjust, <2xs> = # of beats to get there */
  298.  
  299.         eCmdRestoreAccent2, /* restore accent value to master default */
  300.         eCmdSetAccent2, /* specify the new default accent in <1l> */
  301.         eCmdIncAccent2, /* add <1l> to the default accent */
  302.         eCmdSweepAccentAbs2, /* <1l> = new accent, <2xs> = # of beats to get there */
  303.         eCmdSweepAccentRel2, /* <1l> = accent adjust, <2xs> = # of beats to get there */
  304.  
  305.         eCmdRestoreAccent3, /* restore accent value to master default */
  306.         eCmdSetAccent3, /* specify the new default accent in <1l> */
  307.         eCmdIncAccent3, /* add <1l> to the default accent */
  308.         eCmdSweepAccentAbs3, /* <1l> = new accent, <2xs> = # of beats to get there */
  309.         eCmdSweepAccentRel3, /* <1l> = accent adjust, <2xs> = # of beats to get there */
  310.  
  311.         eCmdRestoreAccent4, /* restore accent value to master default */
  312.         eCmdSetAccent4, /* specify the new default accent in <1l> */
  313.         eCmdIncAccent4, /* add <1l> to the default accent */
  314.         eCmdSweepAccentAbs4, /* <1l> = new accent, <2xs> = # of beats to get there */
  315.         eCmdSweepAccentRel4, /* <1l> = accent adjust, <2xs> = # of beats to get there */
  316.  
  317.         /* set pitch displacement depth adjustment */
  318.         eCmdRestorePitchDispDepth, /* restore max pitch disp depth value to default */
  319.         eCmdSetPitchDispDepth, /* set new max pitch disp depth <1l> */
  320.         eCmdIncPitchDispDepth, /* add <1l> to the default pitch disp depth */
  321.         eCmdPitchDispDepthMode, /* <1i>:  -1: Hertz, 0: half-steps */
  322.         eCmdSweepPitchDispDepthAbs, /* <1l> = new depth, <2xs> = # of beats */
  323.         eCmdSweepPitchDispDepthRel, /* <1l> = depth adjust, <2xs> = # of beats */
  324.  
  325.         /* set pitch displacement rate adjustment */
  326.         eCmdRestorePitchDispRate, /* restore max pitch disp rate to the master default */
  327.         eCmdSetPitchDispRate, /* set new max pitch disp rate in seconds to <1l> */
  328.         eCmdIncPitchDispRate, /* add <1l> to the default max pitch disp rate */
  329.         eCmdSweepPitchDispRateAbs, /* <1l> = new rate, <2xs> = # of beats to get there */
  330.         eCmdSweepPitchDispRateRel, /* <1l> = rate adjust, <2xs> = # of beats to get there */
  331.  
  332.         /* set pitch displacement start point, same way as release point */
  333.         eCmdRestorePitchDispStart, /* restore pitch disp start point to default */
  334.         eCmdSetPitchDispStart, /* set the start point to <1l> */
  335.         eCmdIncPitchDispStart, /* add <1l> to the pitch disp start point */
  336.         eCmdPitchDispStartOrigin, /* specify the origin, same as for release point <1i> */
  337.         eCmdSweepPitchDispStartAbs, /* <1l> = new vib start, <2xs> = # of beats */
  338.         eCmdSweepPitchDispStartRel, /* <1l> = vib adjust, <2xs> = # of beats */
  339.  
  340.         /* hurry up adjustment */
  341.         eCmdRestoreHurryUp, /* restore default hurryup factor */
  342.         eCmdSetHurryUp, /* set the hurryup factor to <1l> */
  343.         eCmdIncHurryUp, /* add <1l> to the hurryup factor */
  344.         eCmdSweepHurryUpAbs, /* <1l> = new hurryup factor, <2xs> = # of beats */
  345.         eCmdSweepHurryUpRel, /* <1l> = hurryup adjust, <2xs> = # of beats to get there */
  346.  
  347.         /* default detune */
  348.         eCmdRestoreDetune, /* restore the default detune factor */
  349.         eCmdSetDetune, /* set the detune factor to <1l> */
  350.         eCmdIncDetune, /* add <1l> to current detune factor */
  351.         eCmdDetuneMode, /* <1i>:  -1: Hertz, 0: half-steps */
  352.         eCmdSweepDetuneAbs, /* <1l> = new detune, <2xs> = # of beats */
  353.         eCmdSweepDetuneRel, /* <1l> = detune adjust, <2xs> = # of beats */
  354.  
  355.         /* default early/late adjust */
  356.         eCmdRestoreEarlyLateAdjust, /* restore the default early/late adjust value */
  357.         eCmdSetEarlyLateAdjust, /* set the early/late adjust value to <1l> */
  358.         eCmdIncEarlyLateAdjust, /* add <1l> to the current early/late adjust value */
  359.         eCmdSweepEarlyLateAbs, /* <1l> = new early/late adjust, <2xs> = # of beats */
  360.         eCmdSweepEarlyLateRel, /* <1l> = early/late delta, <2xs> = # of beats to get there */
  361.  
  362.         /* default duration adjust */
  363.         eCmdRestoreDurationAdjust, /* restore the default duration adjust value */
  364.         eCmdSetDurationAdjust, /* set duration adjust value to <1l> */
  365.         eCmdIncDurationAdjust, /* add <1l> to the current duration adjust value */
  366.         eCmdSweepDurationAbs, /* <1l> = new duration adjust, <2xs> = # of beats */
  367.         eCmdSweepDurationRel, /* <1l> = duration adjust delta, <2xs> = # of beats */
  368.         eCmdDurationAdjustMode, /* <1i>:  -1: Multiplicative, 0: Additive */
  369.  
  370.         /* set the meter.  this is used by the editor for placing measure bars. */
  371.         /* measuring restarts immediately after this command */
  372.         eCmdSetMeter, /* <1i> = numerator, <2i> = denominator */
  373.         /* immediately change the measure number */
  374.         eCmdSetMeasureNumber, /* <1i> = new number */
  375.  
  376.         /* set the track transpose to some number of half-steps */
  377.         eCmdSetTranspose, /* <1i> = signed number of half-steps */
  378.         eCmdAdjustTranspose, /* <1i> = added to the current transpose value */
  379.  
  380.         /* text marker in the score */
  381.         eCmdMarker /* <string> holds the text */
  382.     } NoteCommands;
  383.  
  384.  
  385. /* create a new note with space for the specified number of parameters */
  386. NoteObjectRec*                NewNote(void);
  387.  
  388. /* create a new command */
  389. NoteObjectRec*                NewCommand(void);
  390.  
  391. /* dispose of the note or command */
  392. void                                    DisposeNote(NoteObjectRec* Note);
  393.  
  394. /* find out what type of thing it is */
  395. MyBoolean                            IsItACommand(NoteObjectRec* Note);
  396.  
  397.  
  398. /* convert the duration of the note into a fraction */
  399. void                                    GetNoteDurationFrac(NoteObjectRec* Note, struct FractionRec* Frac);
  400.  
  401. /* draw the command on the screen, or measure how many pixels wide the image will be */
  402. /* if it will draw, it assumes the clipping rectangle to be set up properly */
  403. OrdType                                DrawCommandOnScreen(WinType* Window, OrdType X, OrdType Y,
  404.                                                 FontType Font, FontSizeType FontSize, OrdType FontHeight,
  405.                                                 NoteObjectRec* Note, MyBoolean ActuallyDraw, MyBoolean GreyedOut);
  406.  
  407. /* get a static null terminated string literal containing the name of a command */
  408. char*                                    GetCommandName(NoteCommands Command);
  409.  
  410. typedef enum
  411.     {
  412.         eNoParameters EXECUTE(= -425),
  413.         e1SmallExtParameter, /* <1xs> */
  414.         e2SmallExtParameters, /* <1xs> <2xs> */
  415.         e1LargeParameter, /* <1l> */
  416.         eFirstLargeSecondSmallExtParameters, /* <1l> <2xs> */
  417.         e1ParamReleaseOrigin, /* origin <1i> */
  418.         e1PitchDisplacementMode, /* hertz/steps <1i> */
  419.         e2IntegerParameters, /* <1i> <2i> */
  420.         e1DurationAdjustMode, /* multiplicative/additive <1i> */
  421.         e1IntegerParameter, /* <1i> */
  422.         e1StringParameterWithLineFeeds /* <string> */
  423.     } CommandAddrMode;
  424.  
  425. /* get the addressing mode for a command */
  426. CommandAddrMode                GetCommandAddressingMode(NoteCommands Command);
  427.  
  428.  
  429. /* get the actual string argument contained in a command. NIL == not defined yet */
  430. char*                                    GetCommandStringArg(NoteObjectRec* Command);
  431.  
  432. /* get the first numeric argument contained in a command */
  433. long                                    GetCommandNumericArg1(NoteObjectRec* Command);
  434.  
  435. /* get the second numeric argument contained in a command */
  436. long                                    GetCommandNumericArg2(NoteObjectRec* Command);
  437.  
  438. /* get the third numeric argument contained in a command */
  439. long                                    GetCommandNumericArg3(NoteObjectRec* Command);
  440.  
  441. /* put a new string into the command.  the command becomes owner of the string. */
  442. void                                    PutCommandStringArg(NoteObjectRec* Command, char* NewArg);
  443.  
  444. /* put a new first numeric argument into the command */
  445. void                                    PutCommandNumericArg1(NoteObjectRec* Command, long NewValue);
  446.  
  447. /* put a new second numeric argument into the command */
  448. void                                    PutCommandNumericArg2(NoteObjectRec* Command, long NewValue);
  449.  
  450. /* put a new third numeric argument into the command */
  451. void                                    PutCommandNumericArg3(NoteObjectRec* Command, long NewValue);
  452.  
  453.  
  454. /* get the pitch of a note */
  455. short                                    GetNotePitch(NoteObjectRec* Note);
  456.  
  457. /* get the portamento transition time for the note */
  458. double                                GetNotePortamentoDuration(NoteObjectRec* Note);
  459.  
  460. /* get the early/late adjustment factor for a note */
  461. double                                GetNoteEarlyLateAdjust(NoteObjectRec* Note);
  462.  
  463. /* get the duration adjust value for a note */
  464. double                                GetNoteDurationAdjust(NoteObjectRec* Note);
  465.  
  466. /* get a pointer to the note that this note ties to or NIL if there is no tie */
  467. NoteObjectRec*                GetNoteTieTarget(NoteObjectRec* Note);
  468.  
  469. /* get the first release point position from a note */
  470. double                                GetNoteReleasePoint1(NoteObjectRec* Note);
  471.  
  472. /* get the second release point position from a note */
  473. double                                GetNoteReleasePoint2(NoteObjectRec* Note);
  474.  
  475. /* get the overall loudness factor for the note */
  476. double                                GetNoteOverallLoudnessAdjustment(NoteObjectRec* Note);
  477.  
  478. /* get the stereo positioning for the note */
  479. double                                GetNoteStereoPositioning(NoteObjectRec* Note);
  480.  
  481. /* get the surround positioning for the note */
  482. double                                GetNoteSurroundPositioning(NoteObjectRec* Note);
  483.  
  484. /* get the first accent factor for the note */
  485. double                                GetNoteAccent1(NoteObjectRec* Note);
  486.  
  487. /* get the second accent factor for the note */
  488. double                                GetNoteAccent2(NoteObjectRec* Note);
  489.  
  490. /* get the third accent factor for the note */
  491. double                                GetNoteAccent3(NoteObjectRec* Note);
  492.  
  493. /* get the fourth accent factor for the note */
  494. double                                GetNoteAccent4(NoteObjectRec* Note);
  495.  
  496. /* get the pitch that the table selector should treat the note as using */
  497. short                                    GetNoteMultisampleFalsePitch(NoteObjectRec* Note);
  498.  
  499. /* get the pitch displacement depth adjust factor for the note */
  500. double                                GetNotePitchDisplacementDepthAdjust(NoteObjectRec* Note);
  501.  
  502. /* get the pitch displacement rate adjust factor for the note */
  503. double                                GetNotePitchDisplacementRateAdjust(NoteObjectRec* Note);
  504.  
  505. /* get the pitch displacement envelope start point */
  506. double                                GetNotePitchDisplacementStartPoint(NoteObjectRec* Note);
  507.  
  508. /* get the hurryup factor for the note */
  509. double                                GetNoteHurryUpFactor(NoteObjectRec* Note);
  510.  
  511. /* get the detuning adjustment for the note */
  512. double                                GetNoteDetuning(NoteObjectRec* Note);
  513.  
  514.  
  515. /* change the pitch of a note */
  516. void                                    PutNotePitch(NoteObjectRec* Note, short NewPitch);
  517.  
  518. /* get the portamento transition time for the note */
  519. void                                    PutNotePortamentoDuration(NoteObjectRec* Note,
  520.                                                 double NewPortamentoDuration);
  521.  
  522. /* change the early/late adjustment factor for a note */
  523. void                                    PutNoteEarlyLateAdjust(NoteObjectRec* Note, double NewEarlyLate);
  524.  
  525. /* change the duration adjust value for a note */
  526. void                                    PutNoteDurationAdjust(NoteObjectRec* Note,
  527.                                                 double NewDurationAdjust);
  528.  
  529. /* change the pointer to the note that this note ties to. */
  530. void                                    PutNoteTieTarget(NoteObjectRec* Note, NoteObjectRec* NewTieTarget);
  531.  
  532. /* change the first release point position from a note */
  533. void                                    PutNoteReleasePoint1(NoteObjectRec* Note, double NewReleasePoint1);
  534.  
  535. /* change the second release point position from a note */
  536. void                                    PutNoteReleasePoint2(NoteObjectRec* Note, double NewReleasePoint2);
  537.  
  538. /* change the overall loudness factor for the note */
  539. void                                    PutNoteOverallLoudnessAdjustment(NoteObjectRec* Note,
  540.                                                 double NewLoudnessAdjust);
  541.  
  542. /* change the stereo positioning for the note */
  543. void                                    PutNoteStereoPositioning(NoteObjectRec* Note,
  544.                                                 double NewStereoPosition);
  545.  
  546. /* change the surround positioning for the note */
  547. void                                    PutNoteSurroundPositioning(NoteObjectRec* Note,
  548.                                                 double NewSurroundPosition);
  549.  
  550. /* change the first accent factor for the note */
  551. void                                    PutNoteAccent1(NoteObjectRec* Note, double NewAccent1);
  552.  
  553. /* change the second accent factor for the note */
  554. void                                    PutNoteAccent2(NoteObjectRec* Note, double NewAccent2);
  555.  
  556. /* change the third accent factor for the note */
  557. void                                    PutNoteAccent3(NoteObjectRec* Note, double NewAccent3);
  558.  
  559. /* change the fourth accent factor for the note */
  560. void                                    PutNoteAccent4(NoteObjectRec* Note, double NewAccent4);
  561.  
  562. /* change the pitch that the table selector should treat the note as using */
  563. void                                    PutNoteMultisampleFalsePitch(NoteObjectRec* Note,
  564.                                                 short NewFalsePitch);
  565.  
  566. /* change the pitch displacement depth adjust factor for the note */
  567. void                                    PutNotePitchDisplacementDepthAdjust(NoteObjectRec* Note,
  568.                                                 double NewPitchDisplacementDepthAdjust);
  569.  
  570. /* change the pitch displacement rate adjust factor for the note */
  571. void                                    PutNotePitchDisplacementRateAdjust(NoteObjectRec* Note,
  572.                                                 double NewPitchDisplacementRateAdjust);
  573.  
  574. /* change the pitch displacement envelope start point */
  575. void                                    PutNotePitchDisplacementStartPoint(NoteObjectRec* Note,
  576.                                                 double NewPitchDisplacementStartPoint);
  577.  
  578. /* change the hurryup factor for the note */
  579. void                                    PutNoteHurryUpFactor(NoteObjectRec* Note, double NewHurryUpFactor);
  580.  
  581. /* change the detuning adjustment for the note */
  582. void                                    PutNoteDetuning(NoteObjectRec* Note, double NewDetuning);
  583.  
  584.  
  585. /* get the opcode for a command */
  586. unsigned long                    GetCommandOpcode(NoteObjectRec* Command);
  587.  
  588. /* put a new opcode in the command */
  589. void                                    PutCommandOpcode(NoteObjectRec* Command, unsigned long NewOpcode);
  590.  
  591.  
  592. /* get the duration of a note */
  593. unsigned long                    GetNoteDuration(NoteObjectRec* Note);
  594.  
  595. /* get the duration division of a note */
  596. unsigned long                    GetNoteDurationDivision(NoteObjectRec* Note);
  597.  
  598. /* get the dot status of a note */
  599. MyBoolean                            GetNoteDotStatus(NoteObjectRec* Note);
  600.  
  601. /* get the flat or sharp status of a note */
  602. unsigned long                    GetNoteFlatOrSharpStatus(NoteObjectRec* Note);
  603.  
  604. /* get the rest status of a note */
  605. MyBoolean                            GetNoteIsItARest(NoteObjectRec* Note);
  606.  
  607. /* get the first release point origin of a note */
  608. unsigned long                    GetNoteRelease1Origin(NoteObjectRec* Note);
  609.  
  610. /* get the second release point origin of a note */
  611. unsigned long                    GetNoteRelease2Origin(NoteObjectRec* Note);
  612.  
  613. /* get the third release from start instead of end flag of a note */
  614. MyBoolean                            GetNoteRelease3FromStartInsteadOfEnd(NoteObjectRec* Note);
  615.  
  616. /* get the pitch displacement origin of a note */
  617. unsigned long                    GetNotePitchDisplacementStartOrigin(NoteObjectRec* Note);
  618.  
  619. /* get the pitch displacement depth pitch conversion mode of a note */
  620. unsigned long                    GetNotePitchDisplacementDepthConversionMode(NoteObjectRec* Note);
  621.  
  622. /* get the detuning pitch conversion mode of a note */
  623. unsigned long                    GetNoteDetuneConversionMode(NoteObjectRec* Note);
  624.  
  625. /* get the retrigger envelope on tie status of a note */
  626. MyBoolean                            GetNoteRetriggerEnvelopesOnTieStatus(NoteObjectRec* Note);
  627.  
  628. /* get the duration adjustment mode of a note */
  629. unsigned long                    GetNoteDurationAdjustMode(NoteObjectRec* Note);
  630.  
  631. /* get a flag indicating that portamento should use Hertz instead of halfsteps */
  632. MyBoolean                            GetNotePortamentoHertzNotHalfstepsFlag(NoteObjectRec* Note);
  633.  
  634.  
  635. /* change the duration of a note */
  636. void                                    PutNoteDuration(NoteObjectRec* Note, unsigned long NewDuration);
  637.  
  638. /* change the duration division of a note */
  639. void                                    PutNoteDurationDivision(NoteObjectRec* Note,
  640.                                                 unsigned long NewDivision);
  641.  
  642. /* change the dot status of a note */
  643. void                                    PutNoteDotStatus(NoteObjectRec* Note, MyBoolean HasADot);
  644.  
  645. /* change the flat or sharp status of a note */
  646. void                                    PutNoteFlatOrSharpStatus(NoteObjectRec* Note,
  647.                                                 unsigned long NewFlatOrSharpStatus);
  648.  
  649. /* change the rest status of a note */
  650. void                                    PutNoteIsItARest(NoteObjectRec* Note, MyBoolean IsARest);
  651.  
  652. /* change the first release point origin of a note */
  653. void                                    PutNoteRelease1Origin(NoteObjectRec* Note,
  654.                                                 unsigned long NewReleasePoint1Origin);
  655.  
  656. /* change the second release point origin of a note */
  657. void                                    PutNoteRelease2Origin(NoteObjectRec* Note,
  658.                                                 unsigned long NewReleasePoitn2Origin);
  659.  
  660. /* change the third release from start instead of end flag of a note */
  661. void                                    PutNoteRelease3FromStartInsteadOfEnd(NoteObjectRec* Note,
  662.                                                 MyBoolean ShouldWeReleasePoint3FromStartInsteadOfEnd);
  663.  
  664. /* change the pitch displacement origin of a note */
  665. void                                    PutNotePitchDisplacementStartOrigin(NoteObjectRec* Note,
  666.                                                 unsigned long NewPitchDisplacementStartOrigin);
  667.  
  668. /* change the pitch displacement depth pitch conversion mode of a note */
  669. void                                    PutNotePitchDisplacementDepthConversionMode(NoteObjectRec* Note,
  670.                                                 unsigned long NewPitchDisplacementDepthConversionMode);
  671.  
  672. /* change the detuning pitch conversion mode of a note */
  673. void                                    PutNoteDetuneConversionMode(NoteObjectRec* Note,
  674.                                                 unsigned long NewDetuneConversionMode);
  675.  
  676. /* change the retrigger envelope on tie status of a note */
  677. void                                    PutNoteRetriggerEnvelopesOnTieStatus(NoteObjectRec* Note,
  678.                                                 MyBoolean ShouldWeRetriggerEnvelopesOnTie);
  679.  
  680. /* change the duration adjustment mode of a note */
  681. void                                    PutNoteDurationAdjustMode(NoteObjectRec* Note,
  682.                                                 unsigned long NewDurationAdjustMode);
  683.  
  684. /* change the flag indicating that portamento should use Hertz instead of halfsteps */
  685. void                                    PutNotePortamentoHertzNotHalfstepsFlag(NoteObjectRec* Note,
  686.                                                 MyBoolean ShouldWeUseHertzInsteadOfHalfsteps);
  687.  
  688.  
  689. /* read a note object in from a file.  this does not handle ties since they */
  690. /* are done separately. */
  691. FileLoadingErrors            NoteObjectNewFromFile(NoteObjectRec** ObjectOut,
  692.                                                 struct BufferedInputRec* Input);
  693.  
  694. /* write a note object to the file.  this does not handle ties since they are */
  695. /* done separately. */
  696. FileLoadingErrors            NoteObjectWriteDataOut(NoteObjectRec* Note,
  697.                                                 struct BufferedOutputRec* Output);
  698.  
  699. /* make a complete copy of the note/command and any blocks it has allocated */
  700. NoteObjectRec*                DeepCopyNoteObject(NoteObjectRec* Note);
  701.  
  702. #endif
  703.